package dialer.ws.base.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "call_entry", schema = "call_center")
public class CallEntry implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 8094912841019991441L;
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "id", unique = true, nullable = false)
	private Integer id;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_agent")
	private Agent agent;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_contact")
	private Contact contact;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_campaign")
	private CampaignEntry campaignEntry;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_queue_call_entry", nullable = false)
	private QueueCallEntry queueCallEntry;

	@Column(name = "callerid", nullable = false)
	private String callerid;

	@Column(name = "datetime_init")
	private Date datetimeInit;

	@Column(name = "datetime_end")
	private Date datetimeEnd;

	@Column(name = "duration")
	private Integer duration;

	@Column(name = "status")
	private String status;

	@Column(name = "transfer")
	private String transfer;

	@Column(name = "datetime_entry_queue")
	private Date datetimeEntryQueue;

	@Column(name = "duration_wait")
	private Integer durationWait;

	@Column(name = "uniqueid")
	private String uniqueid;

	@Column(name = "trunk", nullable = false)
	private String trunk;

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "callEntry")
	private List<CurrentCallEntry> listCurrentCallEntry;

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "callEntry")
	private List<FormDataRecolectedEntry> listFormDataRecolectedEntry;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Agent getAgent() {
		return agent;
	}

	public void setAgent(Agent agent) {
		this.agent = agent;
	}

	public Contact getContact() {
		return contact;
	}

	public void setContact(Contact contact) {
		this.contact = contact;
	}

	public CampaignEntry getCampaignEntry() {
		return campaignEntry;
	}

	public void setCampaignEntry(CampaignEntry campaignEntry) {
		this.campaignEntry = campaignEntry;
	}

	public QueueCallEntry getQueueCallEntry() {
		return queueCallEntry;
	}

	public void setQueueCallEntry(QueueCallEntry queueCallEntry) {
		this.queueCallEntry = queueCallEntry;
	}

	public String getCallerid() {
		return callerid;
	}

	public void setCallerid(String callerid) {
		this.callerid = callerid;
	}

	public Date getDatetimeInit() {
		return datetimeInit;
	}

	public void setDatetimeInit(Date datetimeInit) {
		this.datetimeInit = datetimeInit;
	}

	public Date getDatetimeEnd() {
		return datetimeEnd;
	}

	public void setDatetimeEnd(Date datetimeEnd) {
		this.datetimeEnd = datetimeEnd;
	}

	public Integer getDuration() {
		return duration;
	}

	public void setDuration(Integer duration) {
		this.duration = duration;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getTransfer() {
		return transfer;
	}

	public void setTransfer(String transfer) {
		this.transfer = transfer;
	}

	public Date getDatetimeEntryQueue() {
		return datetimeEntryQueue;
	}

	public void setDatetimeEntryQueue(Date datetimeEntryQueue) {
		this.datetimeEntryQueue = datetimeEntryQueue;
	}

	public Integer getDurationWait() {
		return durationWait;
	}

	public void setDurationWait(Integer durationWait) {
		this.durationWait = durationWait;
	}

	public String getUniqueid() {
		return uniqueid;
	}

	public void setUniqueid(String uniqueid) {
		this.uniqueid = uniqueid;
	}

	public String getTrunk() {
		return trunk;
	}

	public void setTrunk(String trunk) {
		this.trunk = trunk;
	}

	public List<CurrentCallEntry> getListCurrentCallEntry() {
		return listCurrentCallEntry;
	}

	public void setListCurrentCallEntry(List<CurrentCallEntry> listCurrentCallEntry) {
		this.listCurrentCallEntry = listCurrentCallEntry;
	}

	public List<FormDataRecolectedEntry> getListFormDataRecolectedEntry() {
		return listFormDataRecolectedEntry;
	}

	public void setListFormDataRecolectedEntry(List<FormDataRecolectedEntry> listFormDataRecolectedEntry) {
		this.listFormDataRecolectedEntry = listFormDataRecolectedEntry;
	}

}
